package com.healthy.controller.pc;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.healthy.entity.YgUsers;
import com.healthy.service.YgWalletService;

/**
 * @author Maple.Chen
 * @date 2020年6月16日
 * @description <p>用户账户相关-控制器</p>
 */
@RestController
public class YgWalletController {

	@Autowired
	private YgWalletService yws;
	
	/*
	 * 查询账户余额、积分
	 */
	@RequestMapping(value = "/wallet/query", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
	public JSONObject queryWalletByUid(HttpServletRequest request){
		YgUsers yu = (YgUsers) request.getSession().getAttribute("user");
		String user_id = yu.getUid();
		JSONObject json = yws.queryWalletByUid(user_id);
		return json;
	}
	
}
